home *** CD-ROM | disk | FTP | other *** search
Modula Implementation | 1988-02-13 | 6.0 KB | 173 lines |
- IMPLEMENTATION MODULE Dialog;
-
-
- FROM SYSTEM IMPORT ADDRESS;
- IMPORT GEMAESbase;
- IMPORT AESResources;
- IMPORT AESForms;
- IMPORT AESObjects;
- IMPORT Text;
- IMPORT Screen;
- IMPORT Icon;
-
-
- (*------------------------------------------------------------------*)
-
- PROCEDURE Display ( DialogNumber : INTEGER;
- GrowFromBox : Screen.Box;
- EditField : INTEGER) : INTEGER;
-
- CONST DoNotRedraw = 0;
-
- VAR
- DialogAddress : ADDRESS;
- DialogBorderBox : Screen.Box;
- ObjectId : INTEGER;
- ObjectPtr : Icon.ObjectPtr;
-
- BEGIN
- AESResources.ResourceGetAddr ( GEMAESbase.RTree,
- DialogNumber,
- DialogAddress );
- AESForms.FormCenter ( DialogAddress,
- DialogBorderBox.Origin.X,
- DialogBorderBox.Origin.Y,
- DialogBorderBox.Size.Width,
- DialogBorderBox.Size.Height );
- AESForms.FormDialogue ( GEMAESbase.FormStart,
- GrowFromBox.Origin.X,
- GrowFromBox.Origin.Y,
- GrowFromBox.Size.Width,
- GrowFromBox.Size.Height,
- DialogBorderBox.Origin.X,
- DialogBorderBox.Origin.Y,
- DialogBorderBox.Size.Width,
- DialogBorderBox.Size.Height );
- AESForms.FormDialogue ( GEMAESbase.FormGrow,
- GrowFromBox.Origin.X,
- GrowFromBox.Origin.Y,
- GrowFromBox.Size.Width,
- GrowFromBox.Size.Height,
- DialogBorderBox.Origin.X,
- DialogBorderBox.Origin.Y,
- DialogBorderBox.Size.Width,
- DialogBorderBox.Size.Height );
- AESObjects.ObjectDraw ( DialogAddress,
- 0, 10,
- DialogBorderBox.Origin.X,
- DialogBorderBox.Origin.Y,
- DialogBorderBox.Size.Width,
- DialogBorderBox.Size.Height );
- ObjectId := AESForms.FormDo ( DialogAddress, EditField );
- ObjectPtr := Icon.GetAddress ( DialogNumber, ObjectId );
- ObjectPtr^.State := ObjectPtr^.State - {Icon.Selected};
- AESForms.FormDialogue ( GEMAESbase.FormFinish,
- GrowFromBox.Origin.X,
- GrowFromBox.Origin.Y,
- GrowFromBox.Size.Width,
- GrowFromBox.Size.Height,
- DialogBorderBox.Origin.X,
- DialogBorderBox.Origin.Y,
- DialogBorderBox.Size.Width,
- DialogBorderBox.Size.Height );
- AESForms.FormDialogue ( GEMAESbase.FormShrink,
- GrowFromBox.Origin.X,
- GrowFromBox.Origin.Y,
- GrowFromBox.Size.Width,
- GrowFromBox.Size.Height,
- DialogBorderBox.Origin.X,
- DialogBorderBox.Origin.Y,
- DialogBorderBox.Size.Width,
- DialogBorderBox.Size.Height );
- RETURN (ObjectId);
- END Display;
-
- (*------------------------------------------------------------------*)
-
- PROCEDURE GetText ( DialogNumber : INTEGER;
- FieldNumber : INTEGER;
- VAR Value : ARRAY OF CHAR );
-
- TYPE TedinfoPtrType = POINTER TO Icon.Tedinfo;
-
- VAR
- ObjectPtr : Icon.ObjectPtr;
- TedinfoPtr : TedinfoPtrType;
- TextPtr : Text.StringPtr;
-
- BEGIN
- ObjectPtr := Icon.GetAddress ( DialogNumber, FieldNumber );
- TedinfoPtr := ObjectPtr^.Spec;
- TextPtr := TedinfoPtr^.Text;
- Text.Assign ( TextPtr^, Value );
- END GetText;
-
- (*------------------------------------------------------------------*)
-
- PROCEDURE PutText ( DialogNumber : INTEGER;
- FieldNumber : INTEGER;
- Value : ARRAY OF CHAR );
-
- TYPE TedinfoPtrType = POINTER TO Icon.Tedinfo;
-
- VAR
- ObjectPtr : Icon.ObjectPtr;
- TedinfoPtr : TedinfoPtrType;
- TextPtr : Text.StringPtr;
-
- BEGIN
- ObjectPtr := Icon.GetAddress ( DialogNumber, FieldNumber );
- IF ObjectPtr = NIL THEN
- RETURN;
- END;
- TedinfoPtr := ObjectPtr^.Spec;
- IF TedinfoPtr = NIL THEN
- RETURN;
- END;
- TextPtr := TedinfoPtr^.Text;
- IF TextPtr = NIL THEN
- RETURN;
- END;
- Text.Assign ( Value, TextPtr^ );
- END PutText;
-
- (*------------------------------------------------------------------*)
-
- PROCEDURE Select ( DialogNumber : INTEGER;
- FieldNumber : INTEGER );
-
- VAR ObjectPtr : Icon.ObjectPtr;
-
- BEGIN
- ObjectPtr := Icon.GetAddress ( DialogNumber, FieldNumber );
- ObjectPtr^.State := ObjectPtr^.State + {Icon.Selected};
- END Select;
-
- (*------------------------------------------------------------------*)
-
- PROCEDURE Deselect ( DialogNumber : INTEGER;
- FieldNumber : INTEGER );
-
- VAR ObjectPtr : Icon.ObjectPtr;
-
- BEGIN
- ObjectPtr := Icon.GetAddress ( DialogNumber, FieldNumber );
- ObjectPtr^.State := ObjectPtr^.State - {Icon.Selected};
- END Deselect;
-
- (*------------------------------------------------------------------*)
-
- PROCEDURE IsSelected ( DialogNumber : INTEGER;
- FieldNumber : INTEGER ) : BOOLEAN;
-
- VAR ObjectPtr : Icon.ObjectPtr;
-
- BEGIN
- ObjectPtr := Icon.GetAddress ( DialogNumber, FieldNumber );
- RETURN (Icon.Selected IN ObjectPtr^.State);
- END IsSelected;
-
-
- END Dialog.
-
-